package org.wiztools.awsabstraction;

import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Named;

/**
 *
 * @author subwiz
 */
public class AWSCredentialsImpl implements AWSCredentials {
    
    @Inject @Named(AWSPropKeys.ACCESS_KEY) private String accessKey;
    @Inject @Named(AWSPropKeys.SECRET_KEY) private String secretKey;

    @Override
    public String getAccessKey() {
        return accessKey;
    }

    @Override
    public String getSecretKey() {
        return secretKey;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + Objects.hashCode(this.accessKey);
        hash = 37 * hash + Objects.hashCode(this.secretKey);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AWSCredentialsImpl other = (AWSCredentialsImpl) obj;
        if (!Objects.equals(this.accessKey, other.accessKey)) {
            return false;
        }
        if (!Objects.equals(this.secretKey, other.secretKey)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "AWSCredentialsImpl{" + "accessKey=" + accessKey + ", secretKey (length)=" + secretKey.length() + '}';
    }
    
}
